// 车间类型枚举常量
export const WORKSHOP_TYPE = {
  PRODUCTION: 1, // 生产车间
  ASSEMBLY: 2,   // 装配车间
  PACKING: 3,    // 包装车间
  OTHER: 4       // 其他
} as const;

// 车间类型标签映射
export const WORKSHOP_TYPE_LABELS = {
  [WORKSHOP_TYPE.PRODUCTION]: '生产车间',
  [WORKSHOP_TYPE.ASSEMBLY]: '装配车间',
  [WORKSHOP_TYPE.PACKING]: '包装车间',
  [WORKSHOP_TYPE.OTHER]: '其他'
};

// 获取车间类型标签
export const getWorkshopTypeLabel = (type: number): string => {
  return WORKSHOP_TYPE_LABELS[type as keyof typeof WORKSHOP_TYPE_LABELS] || '未知';
};

// 车间接口定义
export interface BaseWorkshop {
  workshopId: number;
  workshopCode: string;
  workshopName: string;
  warehouseId: number;
  warehouseName: string;
  workshopType: number;
  productionCapacity?: number;
  managerName: string;
  phoneNumber: string;
  address: string;
  description: string;
  isActive: boolean;
  isDeleted: boolean;
  createdBy: string;
  createdAt: string;
  updatedBy: string;
  updatedAt: string;
}

// 车间查询参数
export interface WorkshopQueryParams {
  workshopCode?: string;
  workshopName?: string;
  workshopType?: number;
  isActive?: boolean;
  warehouseId?: number;
  pageSize?: number;
  pageNumber?: number;
}

// 车间分页结果
export interface WorkshopPageResult {
  list: BaseWorkshop[];
  total: number;
  pageSize: number;
  pageNumber: number;
}

// 创建车间参数
export interface WorkshopCreateParams {
  workshopCode: string;
  workshopName: string;
  warehouseId: number;
  workshopType: number;
  productionCapacity?: number;
  managerName: string;
  phoneNumber: string;
  address: string;
  description?: string;
}

// 更新车间参数
export interface WorkshopUpdateParams {
  workshopId: number;
  workshopCode?: string;
  workshopName?: string;
  warehouseId?: number;
  workshopType?: number;
  productionCapacity?: number;
  managerName?: string;
  phoneNumber?: string;
  address?: string;
  description?: string;
}

// 切换车间状态参数
export interface WorkshopStatusParams {
  workshopId: number;
  isActive: boolean;
}